//
// Created by root on 10/7/15.
//

#ifndef MYHTTPSERVER_REQUEST_H
#define MYHTTPSERVER_REQUEST_H

#include "uthash.h"
#include "uthash_help.h"

#define HEAD_CRLF "\r\n"
#define HEAD_METHOD_LINE "method-line"

typedef struct _request {

    char *str;//request string
    uthash *header;//header name-value
    char *method;
    char *url;
    uthash *parameters;

}request;

request * request_init(char *s);

char * get_request_header(request*req, char*name);

char * get_request_parameters(request*req,char*name);

void request_free(request *req);

#endif //MYHTTPSERVER_REQUEST_H
